<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
  <title>新华炫闻</title>
  <style>
 body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin: 0; padding: 0;}
  body,button,input,select,textarea {font:12px/1.4 Arial,Helvetica,'Hiragino Sans GB','Microsoft YaHei',sans-serif;color:#333}
  h1,h2,h3,h4,h5,h6 {font-size: 100%;}
  ul,ol {list-style: none;}
  table {border-collapse: collapse; border-spacing:0}
   img {border:0}
  .left{float:left;}
  .right{float:right;}
  .clearfix:after {content: '\20';display: block;height: 0;clear: both; }
  .clearfix {*zoom: 1;}
  html{background-color:#f4f4f4;font-size:10px;font-family:Microsoft YaHei}

.article_title{margin-top:1.153rem;font-size:1.282rem;height:2.307rem;border-left:1.153rem #00aaec solid;padding-left:0.794rem;line-height:2.307rem;overflow:hidden;}
.article_info{margin-left:1.923rem;font-size:0.615rem;color:#888;overflow:hidden;line-height:1.5rem}
.article_content{margin-left:1.153rem;font-size:0.82rem;height:16.666rem;overflow:auto;margin-right:1.153rem;margin-top:1.153rem}
.article_content p{margin: 0 0 1.153rem;}
.article_content .block{width:78%;margin:0 auto;}
.article_content img{vertical-align:middle;width:32rem}
.inline_pic{text-align:center;margin: 0 0 1.153rem;}
.inline_pic img{vertical-align:middle;max-width:100%;margin-bottom:0.384rem;border-bottom:0.128rem #dad9d9 solid;border-right:0.128rem #dad9d9 solid;}
.inline_pic h3{font-size:0.615rem;font-weight:normal;}


.page{margin-top:1.2rem;text-align:right;margin-right:1.153rem}
.page .btn{display:inline-block;width:1.538rem;height:1.538rem;background:url(images/arrow.png) no-repeat;background-size:6.152rem 1.538rem;margin-left:1.538rem}
#prevBtn{background-position:0 0}
#prevBtn.current{background-position:-1.538rem 0}
#nextBtn{background-position:-3.076rem 0}
#nextBtn.current{background-position:-4.614rem 0}

  </style>
  <script src="<?php echo __STATIC_IMAGE_URL__;?>js/jquery-1.9.1.min.js"></script>
 </head>
 <body>
 <?php

 	$newsid    = $_REQUEST['newsid'];

 	if (empty($newsid))
 	{
 		exit("新闻id为空，无相关数据");
 	}
 	XINHUA::lib('NEWS');
 	$data = NEWS::DETAIL($newsid);

 	$published = $data['published'];
 	$title     = $data['title'];
 	$source    = $data['source'];
    
	$datestr = ""; 
 	if (!empty($published))
 	{
 		$datestr = date('Y-m-d H:i:s', $published);
 	}



 ?>	
 <div class="article_title"><?php  echo $title; ?></div>
 <div class="article_info"><?php  echo $source; echo "&nbsp;"; echo $datestr;?> </div>
  <div class="article_content" id="article_content">

    <div class="block">
  		<?php echo $data['mcontent']; ?>
	</div>


</div>
<!-- 

<div class="page" id="page">
<div class="btn" id="prevBtn"></div>
<div class="btn" id="nextBtn"></div>
</div> -->


<script>
/*
var index= 0;
var $elements= $("#page .btn");
var length= $elements.length;

function switchPage(i){
   if(i== 1){
		$("#article_content").animate({
			scrollTop: $("#article_content").scrollTop() + 200
         },500);
	}else{
	    $("#article_content").animate({
			scrollTop: $("#article_content").scrollTop() - 200
         },500);
	}

}



function setFocus(i){
		$elements.removeClass("current");
        $elements.eq(i).addClass("current");
}

*/

function getSearch(href) {
          href = href || window.location.search;
          console.log("href:"+href);
          var data = {},reg = new RegExp( "([^?=&]+)(=([^&]*))?", "g" );
          href && href.replace(reg,function( $0, $1, $2, $3 ){
              data[ $1 ] = $3;
          });
          console.log("data:"+data);

          return data;
}
//window.onpopstate = function(event) {
//  location.href=decodeURIComponent(getSearch().prevurl);
//};
//history.replaceState({page: 1}, "title 1", "");


function keyDownHandler(e){
     e.preventDefault();
      var article_block = $("#article_content");
      if(e.keyCode == 38){//up
            article_block.animate({scrollTop: article_block.scrollTop() - 200});

      }
      if(e.keyCode == 40){//down
             article_block.animate({scrollTop: article_block.scrollTop() + 200});
      }
  }

$(document).keydown(keyDownHandler);

//78px/3840
(function (doc, win) {
	var docEl = doc.documentElement,
	resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
	recalc = function () {
			var clientWidth = docEl.clientWidth;
			if (!clientWidth) return;
			docEl.style.fontSize = 78 * (clientWidth / 3840 ) + 'px';
	};

	if (!doc.addEventListener) return;
	win.addEventListener(resizeEvt, recalc, false);
	doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
</script>


 </body>
</html>
